Avoid assertion violations in 'try_window_id'
authorEli Zaretskii <eliz@gnu.org>
Mon, 3 Jun 2024 18:13:05 +0000 (21:13 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 3 Jun 2024 18:13:05 +0000 (21:13 +0300)
* src/xdisp.c (try_window_id): Avoid assertions in
'find_first_unchanged_at_end_row' due to 'init_iterator' freeing
all the realized faces.  (Bug#71274)

src/xdisp.c

index 47675fcc80a3f04cc4d824ea20a8cce6fc57116f..3d8651f408690954a518f1122ce6840bd2166d59 100644 (file)
@@ -22337,6 +22337,13 @@ try_window_id (struct window *w)
       start_pos = it.current.pos;
     }
 
+  /* init_to_row_end and start_display above could have caused the
+     window's window_end_valid flag to be reset (e.g., if init_iterator
+     decides to free all realized faces).  We cannot continue if that
+     happens.  */
+  if (!w->window_end_valid)
+    GIVE_UP (108);
+
   /* Find the first row that is not affected by changes at the end of
      the buffer.  Value will be null if there is no unchanged row, in
      which case we must redisplay to the end of the window.  delta